<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<input type="text">
<script src="./axios.js"></script>
<script>
let input = document.getElementsByTagName('input')[0]

axios.defaults.baseURL = 'http://localhost:3000'

axios({
    method:'get',
    url:'http://localhost:3000/user',
    baseURL:'http://localhost:3000',
    params:{id:70},
    timeout:1000,
    responseType:'json',//default
    responseEncoding:'utf8',//default
    // data:{name:'gailun'}, //data通过请求体发送，只适合put，post，patch
    // headers:{},
}).then(data=>{
    console.log(data.data)
}).catch(err=>{
    console.log(err)
})

</script>
</body>
</html>